﻿using System;
using System.IO;

namespace Netbits.Common.Network
{
	public sealed class NetLinkSlotSendItem : IDisposable
	{
		#region Private Variables

		Stream _Stream;
		byte[] _Data;
		int _IndexOf;
		int _Size;

		#endregion

		#region Constructor

		public NetLinkSlotSendItem( Stream Stream_, int Position_, int Size_ )
		{
			_Stream = Stream_;
			_IndexOf = Position_;
			_Size = Size_;
		}

		public NetLinkSlotSendItem( byte[] Data_, int IndexOf_, int Size_ )
		{
			_Data = Data_;
			_IndexOf = IndexOf_;
			_Size = Size_;
		}

		#endregion

		#region Public Properties

		public bool IsStream
		{
			get { return _Stream != null; }
		}

		public Stream Stream
		{
			get { return _Stream; }
		}

		public byte[] Data
		{
			get { return _Data; }
		}

		public int IndexOf
		{
			get { return _IndexOf; }
		}

		public int Position
		{
			get { return _IndexOf; }
		}

		public int Size
		{
			get { return _Size; }
		}

		#endregion

		#region Public Functions

		public void WaitSendFinished()
		{
		}

		#endregion

		#region IDisposable

		public void Dispose()
		{
			_Stream = null;
			_Data = null;
		}

		#endregion
	}
}
